<?php
 
include_once("../configure/configure.php");						//--> global var
include_once ("../admin/configure/admin.config.inc.php");		//-- admin var
include_once("../admin/tools/smarty/libs/Smarty.class.php");	//--> out template
include_once("impl/ShareCouponImpl.php");

include_once("../includeSmarty.php");
include_once("../includeTag.php");
include_once("../includeCategories.php");

include_once("checkLogin.php");// check login status
include_once("control.php");// user global action control

$shareImpl 		= new ShareCouponImpl(DB_TAG_COUPON);

$id		= $_GET['id'];
$page 	= $_GET['page'];


if(!empty($_GET['id'])){

	$isReturn = $shareImpl->delete($id);
	if($isReturn){
		$error_message = 'delete successfully.';
	}else{
		$error_message = 'delete failure.';
	}
}

$oCoupons = $shareImpl->getCoupons($userId);





$smarty->assign('oCoupons', $oCoupons);

$smarty->assign('oTags', $oTags);
$smarty->assign('oCatTree', $oCatTree);

$smarty->assign('userId', $userId);

$smarty->assign('HOME_URL', HOME_URL);
$smarty->assign('HOME_URL_HTTP', HOME_URL_HTTP);
$smarty->assign('error_message', $error_message);


$smarty->display('admin.html');
?>
